;;;Exercise in polyline bulge (arc) math to determin a point for text
;;;on the arc and the angle tangent to that point.
;;;
;;;	Author:
;;;		Henry C. Francis
;;;		425 N. Ashe St.
;;;		Southern Pines, NC 28387
;;;
;;;	http://www.paracadd.com
;;;	All rights reserved.
;;;
;;;
(defun bcen ()
;  (setq nent(nentselp))
  (setq ename (car nent))
  (setq edata (entget ename))
  (COND
    ((assoc 42 edata)
      (if (>(abs(setq bfact (cdr(assoc 42 edata))))0)
        (setq
          chordlen (distance
                     (cdr(assoc 10 edata))
                     (cdr(assoc 10(entget(entnext ename))))
                   )
          chordang (angle
                     (cdr(assoc 10 edata))
                     (cdr(assoc 10(entget(entnext ename))))
                   )
          arcrad   (/
                     (+
                       (*
                         4
                         (/(* chordlen bfact)2)
                         (/(* chordlen bfact)2)
                       )
                       (* chordlen chordlen)
                     )
                     (*
                       8
                       (/(* chordlen bfact)2)
                     )
                   )
          radang   (+(- chordang(*(atan bfact)2))(/ pi 2))
          radpt    (polar (cdr(assoc 10 edata)) radang arcrad)
          textpt   (polar radpt (angle radpt (cadr nent))(abs arcrad))
          lang     (+(angle radpt (cadr nent))(/ pi 2))
        )
      )
    )
    ((eq (cdr (assoc 0 edata)) "ARC")
      (setq
	arcrad     (cdr(assoc 40 edata))
	radpt      (cdr(assoc 10 edata))
	chordlen   (distance
		     (polar radpt (cdr(assoc 50 edata)) arcrad)
		     (polar radpt (cdr(assoc 51 edata)) arcrad)
		   )
	chordang   (angle
		     (polar radpt (cdr(assoc 50 edata)) arcrad)
		     (polar radpt (cdr(assoc 51 edata)) arcrad)
		   )
	textpt     (polar radpt (angle radpt (cadr nent))(abs arcrad))
        lang       (+(angle radpt (cadr nent))(/ pi 2))
      )
    )
  )
)
